tools/ocaml: Fix build error with Arch Linux
authorPetre Pircalabu <ppircalabu@bitdefender.com>
Mon, 28 Oct 2019 16:38:42 +0000 (18:38 +0200)
committerWei Liu <wl@xen.org>
Tue, 29 Oct 2019 12:54:10 +0000 (12:54 +0000)
commit368375d7360a38c27de8e0276498bdd29e9e8a03
treeea70d8fbb3b1dcbe63117457de0a26c50301bccf
parent2a474dc3e229ecdc6a5c0af7eae11a0843de0d1d
tools/ocaml: Fix build error with Arch Linux

gcc (GCC) 9.2.0 complains:

xentoollog_stubs.c: In function ‘stub_xtl_ocaml_vmessage’:
xentoollog_stubs.c:93:16: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   93 |  value *func = caml_named_value(xtl->vmessage_cb) ;
      |                ^~~~~~~~~~~~~~~~

This patch constifies the pointer returned by caml_named_value in order
to the accommodate newer versions of OCaml.
In OCaml >= 4.09 the return value pointer of caml_named_value is
declared const.

https://github.com/ocaml/ocaml/commit/4f03a1467d29cf587df5a191830f1525506ee0e3

Signed-off-by: Petre Pircalabu <ppircalabu@bitdefender.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wl@xen.org>
[ wei: remove spaces before semicolons ]
Signed-off-by: Wei Liu <wl@xen.org>
tools/ocaml/libs/xentoollog/xentoollog_stubs.c
tools/ocaml/libs/xl/xenlight_stubs.c